#ifndef GUARD_DEBUGGER
#define GUARD_DEBUGGER

#include "memory.h"
#include "cpu.h"
#include "ioctl.h"
#include "registerFile.h"
#include "register.h"
#include <ncurses/curses.h>

#define CUSTOM_WIN_START 19
typedef struct
{
	CpuPtr cpu;
	MemoryPtr memory;
	RegisterFilePtr reg_file;
	unsigned short mem_start;
	WINDOW *debug_win;
	WINDOW *register_win[4];
	WINDOW *memory_win;
	WINDOW *specreg_win;
	WINDOW *swdiag_win;
	WINDOW *kbd_win;
} DebuggerStr;

typedef DebuggerStr * DebuggerPtr;


DebuggerPtr new_debugger(CpuPtr cpu);

void debugger_main_loop(DebuggerPtr debugger);

//Load Program this will prompt for a filename
void debugger_load_program(DebuggerPtr debugger);

//Step Program runs the next step of the program
void debugger_step_program(DebuggerPtr debugger);

//Run Program runs the entire loaded program
void debugger_run_program(DebuggerPtr debugger);

//Clear Memory Block //removed for now
//void debugger_clear_memory_block(DebuggerPtr debugger);


//Exit


//refresh the screen
void debugger_update(DebuggerPtr debugger);

//ask the user for a command to run
int debugger_prompt_command(DebuggerPtr debugger);


void debugger_show_mem(DebuggerPtr debugger);

void debugger_show_registers(DebuggerPtr debugger);


void debugger_clear_mem(DebuggerPtr debugger);


#endif
